package Timesheet;

import java.util.Calendar;
import java.util.Date;

import oracle.adfmf.java.beans.PropertyChangeListener;
import oracle.adfmf.java.beans.PropertyChangeSupport;

public class TimesheetDailyReportLine {

    int sheetID = 0;
    int sheetSeq = -1;
    int periodSeq = 0;
    Date dateUnderReport;
    int lineNbr = -1;
    double reportedQty = 0;
    String taskGroup = "";
    String timeReportingCode = "";
    String billableIndicator = "";
    String projectID = "";
    String activityID = "";
    String comment = "";
    private transient PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

    public TimesheetDailyReportLine() {
        super();
    }

    public TimesheetDailyReportLine(int sheetID, int sheetSeq, int periodSeq, Date dur, int lineNbr,
                                    double reportedQty, String taskGroup, String trc, String billableIndicator,
                                    String projectID, String activityID, String comment) {
        super();
        this.sheetID = sheetID;
        this.sheetSeq = sheetSeq;
        this.periodSeq = periodSeq;
        this.dateUnderReport = dur;
        this.lineNbr = lineNbr;
        this.reportedQty = reportedQty;
        this.taskGroup = taskGroup;
        this.timeReportingCode = trc;
        this.billableIndicator = billableIndicator;
        this.projectID = projectID;
        this.activityID = activityID;
        this.comment = comment;
    }

    public void cloneFrom(TimesheetDailyReport srcDailyReportLine) { // TODO
    }

    public void setSheetID(int sheetID) {
        int oldSheetID = this.sheetID;
        this.sheetID = sheetID;
        propertyChangeSupport.firePropertyChange("sheetID", oldSheetID, sheetID);
    }

    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    }

    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    }

    public int getSheetID() {
        return sheetID;
    }

    public void setSheetSeq(int sheetSeq) {
        int oldSheetSeq = this.sheetSeq;
        this.sheetSeq = sheetSeq;
        propertyChangeSupport.firePropertyChange("sheetSeq", oldSheetSeq, sheetSeq);
    }

    public int getSheetSeq() {
        return sheetSeq;
    }

    public void setPeriodSeq(int periodSeq) {
        int oldPeriodSeq = this.periodSeq;
        this.periodSeq = periodSeq;
        propertyChangeSupport.firePropertyChange("periodSeq", oldPeriodSeq, periodSeq);
    }

    public int getPeriodSeq() {
        return periodSeq;
    }

    public void setDateUnderReport(Date dateUnderReport) {
        Date oldDateUnderReport = this.dateUnderReport;
        this.dateUnderReport = dateUnderReport;
        propertyChangeSupport.firePropertyChange("dateUnderReport", oldDateUnderReport, dateUnderReport);
    }

    public Date getDateUnderReport() {
        return dateUnderReport;
    }

    public void setLineNbr(int lineNbr) {
        int oldLineNbr = this.lineNbr;
        this.lineNbr = lineNbr;
        propertyChangeSupport.firePropertyChange("lineNbr", oldLineNbr, lineNbr);
    }

    public int getLineNbr() {
        return lineNbr;
    }

    public void setReportedQty(double reportedQty) {
        double oldReportedQty = this.reportedQty;
        this.reportedQty = reportedQty;
        propertyChangeSupport.firePropertyChange("reportedQty", oldReportedQty, reportedQty);
    }

    public double getReportedQty() {
        return reportedQty;
    }

    public void setTaskGroup(String taskGroup) {
        String oldTaskGroup = this.taskGroup;
        this.taskGroup = taskGroup;
        propertyChangeSupport.firePropertyChange("taskGroup", oldTaskGroup, taskGroup);
    }

    public String getTaskGroup() {
        return taskGroup;
    }

    public void setTimeReportingCode(String timeReportingCode) {
        String oldTimeReportingCode = this.timeReportingCode;
        this.timeReportingCode = timeReportingCode;
        propertyChangeSupport.firePropertyChange("timeReportingCode", oldTimeReportingCode, timeReportingCode);
    }

    public String getTimeReportingCode() {
        return timeReportingCode;
    }

    public void setBillableIndicator(String billableIndicator) {
        String oldBillableIndicator = this.billableIndicator;
        this.billableIndicator = billableIndicator;
        propertyChangeSupport.firePropertyChange("billableIndicator", oldBillableIndicator, billableIndicator);
    }

    public String getBillableIndicator() {
        return billableIndicator;
    }

    public void setProjectID(String projectID) {
        String oldProjectID = this.projectID;
        this.projectID = projectID;
        propertyChangeSupport.firePropertyChange("projectID", oldProjectID, projectID);
    }

    public String getProjectID() {
        return projectID;
    }

    public void setActivityID(String activityID) {
        String oldActivityID = this.activityID;
        this.activityID = activityID;
        propertyChangeSupport.firePropertyChange("activityID", oldActivityID, activityID);
    }

    public String getActivityID() {
        return activityID;
    }

    public void setComment(String comment) {
        String oldComment = this.comment;
        this.comment = comment;
        propertyChangeSupport.firePropertyChange("comment", oldComment, comment);
    }

    public String getComment() {
        return comment;
    }
}
